#ifndef __ENEMY_H__
#define __ENEMY_H__

#include "cocos2d.h"
#include "Creature.h"

using namespace cocos2d;

class Enemy : public Creature 
{
public:
	typedef enum {
		STATE_MOVE,
		STATE_ATTACK,
		STATE_DEAD,
		NUM_OF_STATE,
	} EState;

	Enemy(void);
	~Enemy(void);
	CREATURE_CREATE_FUNC(Enemy);  
	virtual bool init();
	virtual void afterInit();

	void spawn(CCPoint pos);

protected:
	float d_speed;
	float d_stopPos;

	virtual CCAction* getWalkAction() {return NULL;}
	virtual void onDead();
	virtual float onHit(float damage);
	virtual CCFiniteTimeAction* getDieAction();

private:
	CCFiniteTimeAction* getMoveAction();
	void moveEnd(CCNode* sender);
	void showDamageDone(CCNode* sender);

	EState d_state;
	int d_shakeActionTag;

};

#endif // __ENEMY_H__

